
/* First created by JCasGen Mon Mar 28 12:51:53 CEST 2011 */
package ia1011.zanzibar.chaos.type;

import org.apache.uima.jcas.JCas;
import org.apache.uima.jcas.JCasRegistry;
import org.apache.uima.cas.impl.CASImpl;
import org.apache.uima.cas.impl.FSGenerator;
import org.apache.uima.cas.FeatureStructure;
import org.apache.uima.cas.impl.TypeImpl;
import org.apache.uima.cas.Type;
import org.apache.uima.cas.impl.FeatureImpl;
import org.apache.uima.cas.Feature;

/** The complex constituent is a constituent that contains other constituents.
 * Updated by JCasGen Mon Mar 28 12:52:46 CEST 2011
 * @generated */
public class UimaSimpleConstituent_Type extends UimaConstituent_Type {
  /** @generated */
  protected FSGenerator getFSGenerator() {return fsGenerator;}
  /** @generated */
  private final FSGenerator fsGenerator = 
    new FSGenerator() {
      public FeatureStructure createFS(int addr, CASImpl cas) {
  			 if (UimaSimpleConstituent_Type.this.useExistingInstance) {
  			   // Return eq fs instance if already created
  		     FeatureStructure fs = UimaSimpleConstituent_Type.this.jcas.getJfsFromCaddr(addr);
  		     if (null == fs) {
  		       fs = new UimaSimpleConstituent(addr, UimaSimpleConstituent_Type.this);
  			   UimaSimpleConstituent_Type.this.jcas.putJfsFromCaddr(addr, fs);
  			   return fs;
  		     }
  		     return fs;
        } else return new UimaSimpleConstituent(addr, UimaSimpleConstituent_Type.this);
  	  }
    };
  /** @generated */
  public final static int typeIndexID = UimaSimpleConstituent.typeIndexID;
  /** @generated 
     @modifiable */
  public final static boolean featOkTst = JCasRegistry.getFeatOkTst("ia1011.zanzibar.chaos.type.UimaSimpleConstituent");
 
  /** @generated */
  final Feature casFeat_capitalized;
  /** @generated */
  final int     casFeatCode_capitalized;
  /** @generated */ 
  public boolean getCapitalized(int addr) {
        if (featOkTst && casFeat_capitalized == null)
      jcas.throwFeatMissing("capitalized", "ia1011.zanzibar.chaos.type.UimaSimpleConstituent");
    return ll_cas.ll_getBooleanValue(addr, casFeatCode_capitalized);
  }
  /** @generated */    
  public void setCapitalized(int addr, boolean v) {
        if (featOkTst && casFeat_capitalized == null)
      jcas.throwFeatMissing("capitalized", "ia1011.zanzibar.chaos.type.UimaSimpleConstituent");
    ll_cas.ll_setBooleanValue(addr, casFeatCode_capitalized, v);}
    
  
 
  /** @generated */
  final Feature casFeat_marked;
  /** @generated */
  final int     casFeatCode_marked;
  /** @generated */ 
  public boolean getMarked(int addr) {
        if (featOkTst && casFeat_marked == null)
      jcas.throwFeatMissing("marked", "ia1011.zanzibar.chaos.type.UimaSimpleConstituent");
    return ll_cas.ll_getBooleanValue(addr, casFeatCode_marked);
  }
  /** @generated */    
  public void setMarked(int addr, boolean v) {
        if (featOkTst && casFeat_marked == null)
      jcas.throwFeatMissing("marked", "ia1011.zanzibar.chaos.type.UimaSimpleConstituent");
    ll_cas.ll_setBooleanValue(addr, casFeatCode_marked, v);}
    
  
 
  /** @generated */
  final Feature casFeat_tokens;
  /** @generated */
  final int     casFeatCode_tokens;
  /** @generated */ 
  public int getTokens(int addr) {
        if (featOkTst && casFeat_tokens == null)
      jcas.throwFeatMissing("tokens", "ia1011.zanzibar.chaos.type.UimaSimpleConstituent");
    return ll_cas.ll_getRefValue(addr, casFeatCode_tokens);
  }
  /** @generated */    
  public void setTokens(int addr, int v) {
        if (featOkTst && casFeat_tokens == null)
      jcas.throwFeatMissing("tokens", "ia1011.zanzibar.chaos.type.UimaSimpleConstituent");
    ll_cas.ll_setRefValue(addr, casFeatCode_tokens, v);}
    
   /** @generated */
  public int getTokens(int addr, int i) {
        if (featOkTst && casFeat_tokens == null)
      jcas.throwFeatMissing("tokens", "ia1011.zanzibar.chaos.type.UimaSimpleConstituent");
    if (lowLevelTypeChecks)
      return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_tokens), i, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_tokens), i);
  return ll_cas.ll_getRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_tokens), i);
  }
   
  /** @generated */ 
  public void setTokens(int addr, int i, int v) {
        if (featOkTst && casFeat_tokens == null)
      jcas.throwFeatMissing("tokens", "ia1011.zanzibar.chaos.type.UimaSimpleConstituent");
    if (lowLevelTypeChecks)
      ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_tokens), i, v, true);
    jcas.checkArrayBounds(ll_cas.ll_getRefValue(addr, casFeatCode_tokens), i);
    ll_cas.ll_setRefArrayValue(ll_cas.ll_getRefValue(addr, casFeatCode_tokens), i, v);
  }
 



  /** initialize variables to correspond with Cas Type and Features
	* @generated */
  public UimaSimpleConstituent_Type(JCas jcas, Type casType) {
    super(jcas, casType);
    casImpl.getFSClassRegistry().addGeneratorForType((TypeImpl)this.casType, getFSGenerator());

 
    casFeat_capitalized = jcas.getRequiredFeatureDE(casType, "capitalized", "uima.cas.Boolean", featOkTst);
    casFeatCode_capitalized  = (null == casFeat_capitalized) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_capitalized).getCode();

 
    casFeat_marked = jcas.getRequiredFeatureDE(casType, "marked", "uima.cas.Boolean", featOkTst);
    casFeatCode_marked  = (null == casFeat_marked) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_marked).getCode();

 
    casFeat_tokens = jcas.getRequiredFeatureDE(casType, "tokens", "uima.cas.FSArray", featOkTst);
    casFeatCode_tokens  = (null == casFeat_tokens) ? JCas.INVALID_FEATURE_CODE : ((FeatureImpl)casFeat_tokens).getCode();

  }
}



    